<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			
			// 检查登录状态
			const isLogin = uni.getStorageSync('isLogin')
			const userInfo = uni.getStorageSync('userInfo')
			
			if (isLogin && userInfo) {
				// 已登录，跳转到首页
				uni.reLaunch({
					url: '/pages/home/home'
				})
			} else {
				// 未登录，跳转到登录页
				uni.reLaunch({
					url: '/pages/login/login'
				})
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>
